home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / education / pe085.dms / pe085.adf / vowel.amos / vowel.amosSourceCode < prev   
AMOS Source Code  |  1994-05-28  |  11KB  |  327 lines

  1. Dim ALF(2,52),HIS$(5)
  2. Global BX,BY,BN,MK,SS,ST,ALF(),HIS$(),BBSX,BBSY,BB,TM,DUN,SCR,CLK,NM$,WP,SP1,SP2,ADV,IM,BBM
  3. '
  4. '
  5. KICK
  6. ME
  7. '
  8. '
  9. Procedure COOKIE_UP
  10.    BX=ALF(1,BN) : BY=ALF(2,BN) : BBX=BX+32 : BBY=BY+34 : Inc CLK
  11.    Get Bob 0,1,BX,BY To BBX,BBY : Hot Spot 1,$11
  12.    If BN<13
  13.       ST=BN : Sam Bank 5
  14.    Else 
  15.       ST=BN-12 : Sam Bank 6
  16.    End If 
  17.    Sam Play 15,ST,8200 : SLEEP[25] : MK=0
  18. End Proc
  19. Procedure SLEEP[TL]
  20.    Timer=0
  21.    While Timer<TL
  22.       Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),IM : Wait Vbl 
  23.    Wend 
  24. End Proc
  25. Procedure PHIL
  26.    TX=1 : TY=1
  27.    For N=1 To 9
  28.       ALF(1,N)=TX : ALF(2,N)=TY
  29.       Add TX,32
  30.    Next N
  31.    TY=36 : TX=1
  32.    For N=10 To 18
  33.       ALF(1,N)=TX : ALF(2,N)=TY
  34.       Add TX,32
  35.    Next N
  36.    TY=71 : TX=1
  37.    For N=19 To 26
  38.       ALF(1,N)=TX : ALF(2,N)=TY
  39.       Add TX,32
  40.    Next N
  41.    TY=106 : TX=1
  42.    For N=27 To 35
  43.       ALF(1,N)=TX : ALF(2,N)=TY
  44.       Add TX,32
  45.    Next N
  46.    TY=141 : TX=1
  47.    For N=36 To 44
  48.       ALF(1,N)=TX : ALF(2,N)=TY
  49.       Add TX,32
  50.    Next N
  51.    TY=176 : TX=1
  52.    For N=45 To 52
  53.       ALF(1,N)=TX : ALF(2,N)=TY
  54.       Add TX,32
  55.    Next N
  56. End Proc
  57. Procedure TITLE
  58.    Restore 
  59.    For N=1 To 5
  60.       Read C,TX,TY
  61.       X=ALF(1,C) : Y=ALF(2,C)
  62.       Screen Copy 0,X,Y,X+32,Y+34 To 1,TX,TY
  63.    Next N
  64.    For N=1 To 4
  65.       Read C,TX,TY
  66.       X=ALF(1,C) : Y=ALF(2,C)
  67.       Screen Copy 0,X,Y,X+32,Y+34 To 1,TX,TY
  68.    Next N
  69.    Locate ,21 : Pen 1 : Paper 0
  70.    Centre "Copyright ï¿½ 1994  Duncan Moran" : Print : Print 
  71.    Centre "Please wait a moment"
  72.    Data 27,65,70,12,102,70,16,138,70,8,176,70,1,214,70
  73.    Data 45,77,120,14,115,120,1,153,120,16,191,120
  74.    Sam Bank 7 : Sam Play 15,1,3000
  75. End Proc
  76. Procedure BANG
  77.    Bob Off 1 : Sam Bank 7 : Sam Play 9,3,7000 : Sam Play 6,3,9000
  78.    Bob 7,BBSX+15,BBSY+10,2 : Wait 10
  79.    Bob 7,BBSX+15,BBSY+10,3 : Wait 10
  80.    Bob 7,BBSX+15,BBSY+10,4 : Wait 10
  81.    Bob 7,BBSX+15,BBSY+10,5 : Wait 10 : Bob Off 3
  82.    Bob 7,BBSX+15,BBSY+10,4 : Wait 10
  83.    Bob 7,BBSX+15,BBSY+10,3 : Wait 10
  84.    Bob Off 7 : Y Mouse=100
  85.    If BN=BB Then SCR=SCR+(25-CLK)
  86.    If BN=BB-26 Then SCR=SCR+(50-CLK)
  87.    S$=Str$(SCR)-" " : S$="000"+S$ : S$=Right$(S$,3) : Text 230,20,S$ : BADDIES
  88.    Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),IM : Wait Vbl 
  89. End Proc
  90. Procedure BADDIES
  91.    Swap SP1,SP2
  92.    BB=Rnd(51)+1 : BX=ALF(1,BB) : BY=ALF(2,BB) : BBSX=SP1 : BBSY=15 : CLK=0
  93.    Get Bob 0,6,BX,BY To BX+32,BY+34 : Hot Spot 3,$11 : BST=BB : If BST>26 Then BST=BST-26
  94.    Volume 10 : Sam Bank 7 : Sam Play 15,2,12000
  95.    For N=1 To 3
  96.       Bob 3,BBSX,BBSY,6 : Wait 5
  97.       Bob Off 3 : Wait 5 : Sam Play 15,2,10000
  98.       Bob 3,BBSX,BBSY,6 : Wait 3
  99.       Bob 3,BBSX,BBSY,6 : Wait 2 : Sam Play 15,2,12000
  100.    Next N
  101.    Volume 20
  102.    If ADV and Rnd(5)<4 Then IM=8 Else IM=1
  103. End Proc
  104. Procedure CLOCK
  105.    T$=Str$(TM)-" " : T$="000"+T$ : T$=Right$(T$,3)
  106.    Text 10,20,T$ : If TM=<0 Then DUN=True : Pop Proc
  107.    TM=TM-1
  108.    Every On 
  109. End Proc
  110. Procedure OVER
  111.    Every Off : Wait Vbl : Bob Off : Cls 0 : Set Font 0 : Sam Bank 7 : DUN=False : BN=1
  112.    Locate ,10 : Pen 1 : Paper 0
  113.    Centre "YOUR TIME IS UP." : Print : Print : Sam Play 15,4,8000 : Wait 25
  114.    T$="YOUR SCORE WAS"+Str$(SCR)+"."
  115.    Centre T$ : Print : Print : Sam Play 15,4,6000 : Wait 25 : Sam Play 15,4,3000
  116.    If SCR>Val(Right$(HIS$(5),3)) Then BORD
  117.    HERE:
  118.    Locate ,17 : Wait Vbl 
  119.    Centre "  LEFT to PLAY again  " : Print : Print 
  120.    Centre "or RIGHT to QUIT" : Print "" : MK=0 : Wait 5
  121.    Repeat : MK=Mouse Key : CHK$=Inkey$ : Wait Vbl : Until MK>0 or Lower$(CHK$)="r"
  122.    If Lower$(CHK$)="r" Then REST : SLIP : Goto HERE
  123.    If MK=2 Then Erase 5 : Erase 6 : Show : Cls 0 : Screen Close 1 : Limit Mouse : Run "RAM:title.amos"
  124.    Sam Bank 7 : Cls 0 : Sam Play 15,1,3000 : Wait 5 : SUCK : Cls 0
  125. End Proc
  126. Procedure KICK
  127.    Volume 20 : Colour Back $FFF : Screen Open 1,320,254,16,Lowres : Screen Display 1,128,42,, : Flash Off : Curs Off : Screen Hide 1 : Get Fonts : Set Font 3
  128.    Unpack 10 To 0 : Screen Hide 0 : Wait Vbl : Screen 1 : Screen Show 1 : Get Palette 0 : Cls 0
  129.    Hide : PHIL : TITLE : Open In 1,"kids-5:his" : For N=1 To 5 : Input #1,HIS$(N) : Next N : Close 1
  130.    Load "kids-5:a2l.abk",5 : Load "kids-5:m2z.abk",6
  131.    SWITCH
  132.    Colour Back $FFF : Cls 0 : Double Buffer : Ink 1,6
  133.    Reserve Zone 2 : Set Zone 1,75,20 To 230,85 : Set Zone 2,94,180 To 204,200
  134.    Limit Mouse 217,77 To 348,266
  135. End Proc
  136. Procedure ME
  137.    STRT:
  138.    Trap Reserve As Data 12,10000000 : Set Font 3
  139.    Paste Icon 84,170,1 : BX=1 : BY=1 : BN=1 : SS=0 : ST=0 : TM=120 : SCR=0 : SP1=10 : SP2=250
  140.    Set Font 0 : Ink 11,14
  141.    Text 0,245,"                                        " : Text 112,242,"Danger Zone"
  142.    Text 0,10,"                                        "
  143.    T$="Regular" : If ADV Then T$="Advanced"
  144.    Text 0,18,"                                        " : Text 124,13,T$ : Set Font 3
  145.    Ink 14 : Draw 75,20 To 75,246 : Draw 230,22 To 230,246 : Draw 75,100 To 230,100
  146.    Draw 74,20 To 74,246 : Draw 231,22 To 231,246 : Draw 75,101 To 230,101 : Ink 1
  147.    BADDIES : Text 10,20,"120" : Text 230,20,"000" : Sam Play 15,3,5000 : SLEEP[50]
  148.    Sam Bank 5 : COOKIE_UP : Every 50 Proc CLOCK : X Mouse=276 : Y Mouse=92 : IM=1 : If ADV Then BBM=12 Else BBM=8
  149.    Do 
  150.       Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),IM : Wait Vbl 
  151.       Repeat 
  152.          Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),IM : Wait Vbl 
  153.          MK=Mouse Key : MZ=Mouse Zone
  154.          If MZ=2
  155.             If(BN=BB or BN=BB-26)
  156.                BANG
  157.             Else 
  158.                NAH
  159.             End If 
  160.          End If 
  161.       Until(MK>0 and MZ=1) or DUN
  162.       If DUN : OVER : Bob Off 1 : Goto STRT : End If 
  163.       Add BBSY,BBM : Bob 3,BBSX,BBSY,6 : If BBSY>220 Then SCR=SCR-25 : BANG
  164.       If MK=3 : Show : Erase 5 : Erase 6 : Edit : End If 
  165.    If MK=1 : Add BN,1,1 To 26 Else Add BN,-1,1 To 26 : End If 
  166.       COOKIE_UP
  167.    Loop 
  168. End Proc
  169. Procedure NAH
  170.    Sam Bank 7 : Volume 10 : X=X Bob(3) : Y=Y Bob(3) : I=I Bob(3) : Y Mouse=82 : X Mouse=285
  171.    For N=1 To 6
  172.       Bob Off 1 : Sam Play 15,2,10000 : Wait 2 : Bob 1,148,50,IM : Wait 2
  173.       Bob Off 3 : Sam Play 15,2,8000 : Wait 2 : Bob 3,X,Y,I : Wait 2
  174.    Next N
  175.    Volume 20 : Bob 3,X,Y,I
  176. End Proc
  177. Procedure BORD
  178.    SRT
  179.    SLIP
  180.    Pen 1 : Locate ,17 : Centre "   SAVING YOUR SCORE   " : Wait Vbl 
  181.    Open Out 1,"kids-5:his" : For N=1 To 5 : Print #1,HIS$(N) : Next N : Close 1
  182. End Proc
  183. Procedure REST
  184.    Restore : Sam Bank 7 : Cls 0 : Sam Play 15,1,3000
  185.    For N=1 To 5
  186.       Read N$
  187.       HIS$(N)=N$
  188.    Next N
  189.    Data "Angharad.......500"
  190.    Data "Haydn..........400"
  191.    Data "Wendy..........300"
  192.    Data "Duncan.........200"
  193.    Data "Me.............100"
  194.    Pen 1 : Locate ,17 : Centre "RESETTING HIGH SCORES" : Wait Vbl : Print : Cline : Print : Cline : Print 
  195.    Open Out 1,"kids-5:his" : For N=1 To 5 : Print #1,HIS$(N) : Next N : Close 1
  196. End Proc
  197. Procedure SRT
  198.    CSC=0
  199.    For N=1 To 5
  200.       V=Val(Right$(HIS$(N),3))
  201.       If SCR>V and CSC=0
  202.          Locate 8,8 : WP=N
  203.          For M=5 To N Step -1
  204.             HIS$(M)=HIS$(M-1)
  205.          Next M
  206.          GRAM
  207.          Locate 8,8 : Cline : Curs Off : S$=Str$(SCR)-" "
  208.          If Len(S$)<3 : S$="0"+S$ : End If 
  209.          HIS$(N)=NM$+String$(".",15-Len(NM$))+S$
  210.          CSC=1
  211.       End If 
  212.    Next N
  213. End Proc
  214. Procedure GRAM
  215.    Curs On 
  216.    HH:
  217.    LC=0
  218.    NM$=""
  219.    Locate 8,18 : Cline : Locate 8,18
  220.    Print "Enter your NAME: ";
  221.    Do 
  222.       Repeat 
  223.          A$=Inkey$
  224.       Until A$<>""
  225.       A=Asc(A$) : BN=A-96
  226.       Exit If A=13
  227.       Exit If A=8
  228.       If A>64 and A<91 : A=A+32 : End If 
  229.       If A=32 or(A>96 and A<123)
  230.          Inc LC
  231.          Exit If LC=10
  232.          If LC=1 : A=A-32 : End If 
  233.          A$=Chr$(A)
  234.          Print A$;
  235.          If BN>0 and BN<27
  236.             If BN<13
  237.                ST=BN : Sam Bank 5
  238.             Else 
  239.                ST=BN-12 : Sam Bank 6
  240.             End If 
  241.             Sam Play 15,ST,8200 : Wait 5
  242.          Else 
  243.             Bell 50
  244.          End If 
  245.          NM$=NM$+A$
  246.       Else 
  247.          Bell 30
  248.       End If 
  249.    Loop 
  250.    If A=8 or LC=10 : Goto HH : End If 
  251.    Cls 0
  252. End Proc
  253. Procedure SLIP
  254.    Screen Hide : Cls : Wait Vbl : Cls : Locate ,2 : Centre "HIGH SCORES" : Print 
  255.    For N=1 To 5
  256.       Locate 11,7+N : If N=WP Then Pen 1 Else Pen N+9
  257.       Print HIS$(N)
  258.    Next N
  259.    Screen Show 1 : Wait Vbl : Pen 1
  260. End Proc
  261. Procedure SWITCH
  262.    Screen 1 : Sam Bank 7 : L=1 : VISI=True
  263.    T1$="  Click to continue  " : T2$="                 " : Timer=0 : P=9
  264.    Repeat 
  265.       Wait Vbl : Restore 
  266.       If Timer mod 20=0
  267.          Swap T1$,T2$ : Add P,1,10 To 14 : Pen P
  268.       End If 
  269.       If Timer mod 25=0
  270.          Sam Play 9,2,(P*1100)/2
  271.          If VISI
  272.             For N=1 To L
  273.                Read AL,TX,TY
  274.             Next N
  275.             Cls 0,TX,TY To TX+32,TY+32 : Add L,1,1 To 3 : VISI=False
  276.          Else 
  277.             For N=1 To 3
  278.                Read C,TX,TY
  279.                X=ALF(1,C) : Y=ALF(2,C)
  280.                Screen Copy 0,X,Y,X+32,Y+34 To 1,TX,TY
  281.             Next N
  282.             VISI=True
  283.          End If 
  284.          Sam Play 6,4,(P*425)
  285.       End If 
  286.       Locate ,23 : Centre T1$
  287.       MK=Mouse Key
  288.    Until MK>0
  289.    SUCK
  290.    Data 27,65,70,1,214,70
  291.    Data 1,153,120
  292. End Proc
  293. Procedure SUCK
  294.    STRT:
  295.    Pen 1 : Sam Bank 7 : Sam Play 15,1,3000 : Wait 10
  296.    MK=0 : Cls 0 : Locate ,10 : Centre "Left for Regular"
  297.    Locate ,12 : Centre "Right for Advanced"
  298.    Locate ,17 : Centre "Help for help" : Wait 10
  299.    Repeat : MK=Mouse Key : A$=Inkey$ : S=Scancode : Until MK>0 or S=95
  300.    If S=95 Then HELPER : Goto STRT
  301.    If MK=2 Then ADV=True Else ADV=False
  302.    Sam Bank 7 : Sam Play 15,1,3000
  303. End Proc
  304. Procedure HELPER
  305.    Cls 0 : Home : Pen 11 : Print : Print : Centre "ALPHA SNAP" : Print : Print 
  306.    Sam Bank 7 : Sam Play 15,1,3000 : Wait 10 : Pen 1
  307.    Centre "Match one letter to another" : Print 
  308.    Centre "Point mouse in the top central box" : Print 
  309.    Centre "Left button to go up the alphabet" : Print 
  310.    Centre "Right button to go down the alphabet" : Print 
  311.    Centre "When you find a match place your" : Print 
  312.    Centre "letter in the SNAP box" : Print : Print 
  313.    Centre "Gain points by using fewer clicks" : Print 
  314.    Centre "Bonus points for matching your little" : Print 
  315.    Centre "letter to a BIG letter" : Print : Print 
  316.    Centre "Score is reduced if a letter reaches" : Print 
  317.    Centre "The Danger Zone" : Print : Print 
  318.    Centre "Regular level lets you go the" : Print 
  319.    Centre "long way round the Advanced level" : Print 
  320.    Centre "does not." : Print : Print 
  321.    Centre "While looking at the scores you can " : Print 
  322.    Centre "press the R key to Reset the" : Print 
  323.    Centre "High Scores to the default scores" : Print : Print 
  324.    Pen 11 : Centre "Click to continue" : Print 
  325.    Repeat : Until Mouse Key>0
  326.    Cls 0 : Pen 1
  327. End Proc